{
char buf[4];
- gbfread(&buf, 1, sizeof(buf), file);
+ is_fatal((gbfread(&buf, 1, sizeof(buf), file) != sizeof(buf)),
+ "%s: Unexpected end of file (%s)!\n", file->module, file->name);
if (file->big_endian)
return be_read32(buf);
{
char buf[2];
- gbfread(&buf, 1, sizeof(buf), file);
+ is_fatal((gbfread(&buf, 1, sizeof(buf), file) != sizeof(buf)),
+ "%s: Unexpected end of file (%s)!\n", file->module, file->name);
if (file->big_endian)
return be_read16(buf);
{
char buf[8];
- gbfread(&buf, 1, sizeof(buf), file);
+ is_fatal((gbfread(&buf, 1, sizeof(buf), file) != sizeof(buf)),
+ "%s: Unexpected end of file (%s)!\n", file->module, file->name);
return endian_read_double(buf, ! file->big_endian);
}
{
char buf[4];
- gbfread(&buf, 1, sizeof(buf), file);
+ is_fatal((gbfread(&buf, 1, sizeof(buf), file) != sizeof(buf)),
+ "%s: Unexpected end of file (%s)!\n", file->module, file->name);
return endian_read_float(buf, ! file->big_endian);
}